home *** CD-ROM | disk | FTP | other *** search
- #include "presto.h"
-
- int debug_level = 5;
-
- Spinlock debug_lock;
- //int debug_lock = 0;
- dstream dout(10);
-
- dstream::dstream (int print_level, int flush)
- {
- d_print_level = print_level;
- d_flush = flush;
- }
-
- void
- dstream::operator<< (char* s)
- {
- //#ifdef debug
- if (debug_level >= d_print_level) {
- debug_lock.lock();
- // s_lock(&debug_lock);
- cout << s;
- if (d_flush) cout.flush();
- debug_lock.unlock();
- // s_unlock(&debug_lock);
- }
- //#endif
- }
-